$.ajaxPrefilter(function (options) {
    options.url = 'http://ajax.frontend.itheima.net' + options.url
    // console.log(options.url);
    options.headers = {
        Authorization: localStorage.getItem('token') || ''
    }

    //认证身份
    options.complete = function (res) {
        if (res.responseJSON.status === 1 && res.responseJSON.message === '身份认证失败！') {
            //强制清空token
            // localStorage.removeItem('token');
            location.href = '/login.html';
        }
    }

})